
<style type="text/css">
  .xj_price{display: none;}
</style>
<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
    <div class="layui-card-body">
         <div class="layui-form-item">
                    <label class="layui-form-label label-required">访客姓名</label>
                 <div class="layui-input-block">
              <input name="name" value='' disabled="disabled" placeholder="" class="layui-input">
          </div>
         </div>

        <div class="layui-form-item">
            <label class="layui-form-label label-required">微信消息类型</label>
        <div class="layui-input-block">
            <select  id="wxtpl_type" class="layui-select" name="wxtpl" lay-filter="wxtpl_type" >
            <option value="">-- 选择发送微信消息模板 --</option>
            <option value="1">到访消息</option>
            <option value="2">通用通知</option>
            </select>
            </div>
             </div>

<!--             <div class="layui-form-item xj_price" id="xj_price">
            <label class="layui-form-label label-required">缴费金额</label>
        <div class="layui-input-block">
             <input required style="width:130px" class="layui-input inline-block text-center padding-left-0" name="price" data-blur-number="2" value="0.01"> 
            </div>
             </div>

 -->
        <div class="layui-form-item">
            <label class="layui-form-label label-required">消息内容</label>
            <div class="layui-input-block">
                <input name="wxmessag" value='' required placeholder="请输入消息内容" class="layui-input">
            </div>
        </div>



    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input style="display: none;"  value='{$vo.id}' name='id'>{/notempty}

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>发送消息</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>

<script type="text/javascript">
  layui.use(['element','form'], function(){
    var element = layui.element;
    var form = layui.form;
    var  layer = layui.layer;
 
 form.on('select(wxtpl_type)', function (data) {
         var message=$("select[name=wxtpl").val();
         if(message ==1){
            $('.xj_price').css({
              'display':'block'
            })
         }else{
             $('.xj_price').css({
              'display':'none'
            })
         }

      });


 form.on('select(commodity_list)', function (data) {
         var iteValue = $("select[name=commodity_list").find("option:selected").data("price");
         if(iteValue){
            $("input[name='price']").val(iteValue)
         }else{
            $("input[name='price']").val(0.01)
         }

      });

});
</script>
    <script>

    window.form.render();

</script>



</form>


